<?php
namespace Admin\Controller;
class DriverController extends CommonController
{
    public function index(){
        $this->assign('pages', 3);
        $this->display();
    }
    public function listTable($page = 1){
        $driver    = M('driver');
        $where     = ' 1=1 ';
        $list      = $driver->page($page, C('ADMIN_PAGES'))->where($where)->order('id desc')->select();
        $counts    = $driver->where($where)->count();
        $totalPage = $counts % C('ADMIN_PAGES') == 0 ? $counts / C('ADMIN_PAGES') : floor($counts / C('ADMIN_PAGES')) + 1;
        $this->assign('totalPage', $totalPage);
        $this->assign('list', $list);
        $this->display();
    }
}
